package analizator;

import analizator.Analizator.Atom;

/**
 *
 * @author bufu
 */
public class Operator implements Atom {

    public String m_value;
    private int m_line, m_column;

    public Operator(String value, int line, int column) {
        m_value = value;
        m_line = line;
        m_column = column;
    }

    @Override
    public String toString() {
        return "Operator " + m_value + " " + m_line + " " + m_column;
    }

    /*public static Operator makeAtom(FileProvider provider) {
        Caracter c = provider.getCharacter(), temp;
        if (c == null) {
            return null;
        }
        switch (c.value) {
            case '+':
                return new Operator("+", c.line, c.column);
            case '-':
                return new Operator("-", c.line, c.column);
            case '*':
                return new Operator("*", c.line, c.column);
            case '/':
                return new Operator("/", c.line, c.column);
            case '(':
                return new Operator("(", c.line, c.column);
            case ')':
                return new Operator(")", c.line, c.column);
            case '[':
                return new Operator("[", c.line, c.column);
            case ']':
                return new Operator("]", c.line, c.column);
            case '=':
                return new Operator("=", c.line, c.column);
            case '<':
                temp = provider.getCharacter();
                if (temp.value == '=') {
                    return new Operator("<=", c.line, c.column);
                } else if (temp.value == '>') {
                    return new Operator("<>", c.line, c.column);
                } else {
                    provider.putCharacter(temp);
                    return new Operator("<", c.line, c.column);
                }
            case '>':
                temp = provider.getCharacter();
                if (temp.value == '=') {
                    return new Operator(">=", c.line, c.column);
                } else {
                    provider.putCharacter(temp);
                    return new Operator(">", c.line, c.column);
                }
            case ':':
                temp = provider.getCharacter();
                if (temp.value == '=') {
                    return new Operator(":=", c.line, c.column);
                } else {
                    provider.putCharacter(temp);
                    provider.putCharacter(c);
                    return null;
                }
            default:
                provider.putCharacter(c);
                return null;
        }*/
   // }
}
